package com.bwf.servlet;

import com.bwf.pojo.Student;
import com.bwf.service.StudentServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/6/13 9:46
 * @Copyright 博为峰
 */
@WebServlet(urlPatterns = "/stu")
public class StudentServlet extends BaseServlet {
    public String list(HttpServletRequest request, HttpServletResponse response) {
        StudentServiceImpl studentService = new StudentServiceImpl();
        ArrayList<Student> list = studentService.list();
        request.setAttribute("list", list);
        return "forward:/student.jsp";
    }
}
